<% if mobile? %>
  <div class="container">
    <form id="mobile-search-form" class="form-horizontal" action="/search" method="GET">
      <input class="form-control" name="q" type="text" value="<%= params[:q] %>" placeholder="搜索本站内容"/>
    </form>
  </div>
<%end%>

<div class="panel panel-default">
  <div class="panel-body">
    <%= raw SiteConfig.index_html %>
  </div>
</div>

<div class="row home-icons hidden-sm hidden-xs">
    <div class="col-md-3">
        <div class="item item1">
            <div class="icon">
                <a href="<%= topics_path %>"><i class="fa fa-comments-o"></i></a>
            </div>
            <div class="text">
                <a href="<%= topics_path %>">TesterHome 社区 <i class="pull-right fa fa-arrow-right"></i></a>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="item item2">
            <div class="icon">
                <a href="<%= pages_path %>"><i class="fa fa-file-text"></i></a>
            </div>
            <div class="text">
                <a href="<%= pages_path %>">技术文档 <i class="pull-right fa fa-arrow-right"></i></a>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="item item3">
            <div class="icon">
                <a href="<%= jobs_path %>"><i class="fa fa-users"></i></a>
            </div>
            <div class="text">
                <a href="<%= jobs_path %>" title="测试相关的招聘与求职">招聘与求职 <i class="pull-right fa fa-arrow-right"></i></a>
            </div>
        </div>
    </div>
    <div class="col-md-3">
        <div class="item item4">
            <div class="icon">
                <a href="<%= popular_topics_path %>"><i class="fa fa-star"></i></a>
            </div>
            <div class="text">
                <a href="<%= popular_topics_path %>">精华文章 <i class="pull-right fa fa-arrow-right"></i></a>
            </div>
        </div>
    </div>
</div>

<div class="home_suggest_topics panel panel-default">
    <div class="panel-heading">最新帖子</div>
    <div class="panel-body topics row">
        <%
           odd_topics, even_topics = @latest_topics.partition.each_with_index { |t, i| i.odd?  }
        %>
        <div class="col-md-6">
            <% cache([odd_topics, "odd"]) do %>
                <%= render partial: "topics/topic", collection: odd_topics, locals: { suggest: false } %>
            <% end %>
        </div>

        <div class="col-md-6">
            <% cache([even_topics, "even"]) do %>
                <%= render partial: "topics/topic", collection: even_topics, locals: { suggest: false } %>
            <% end %>
        </div>
    </div>
    <div class="panel-footer">
        <%= link_to "查看更多...", recent_topics_path %>
    </div>
</div>

<div class="home_suggest_topics panel panel-default">
  <div class="panel-heading">社区精华帖</div>
  <div class="panel-body topics row">
    <%
      odd_topics, even_topics = @excellent_topics.partition.each_with_index { |t, i| i.odd?  }
    %>
    <div class="col-md-6">
      <% cache([odd_topics, "odd"]) do %>
        <%= render partial: "topics/topic", collection: odd_topics, locals: { suggest: false } %>
      <% end %>
    </div>

    <div class="col-md-6">
      <% cache([even_topics, "even"]) do %>
        <%= render partial: "topics/topic", collection: even_topics, locals: { suggest: false } %>
      <% end %>
    </div>
  </div>
  <div class="panel-footer">
    <%= link_to "查看更多精华帖...", excellent_topics_path %>
      <% if not mobile? %>
          <%= link_to(raw("<i class=\"fa fa-rss\"></i>"), feedgood_topics_url, :title => t("topics.subscribe_good_with_rss", :name => Setting.app_name), :class => "feed") %>
      <% end %>
  </div>
</div>

<% if !mobile? %>
  <%= render "/shared/index_sections" %>
  <%= render "/shared/hot_locations" %>
<% end %>